<?php include('includes/before_html.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

    <head>

        <meta http-equiv="content-type" content="text/html; charset=utf-8" />

        <meta name="description" content="" />

        <meta name="keywords" content="" />

        <meta name="author" content="" />

        <?php include('includes/head.php'); ?>

        <title><?php echo $heading ?></title>

    </head>

    <body>

        <div id="wrapper">

            <?php include('includes/header.php'); ?>

            <?php include('includes/nav.php'); ?>

            <div id="content">
                <?php
                $show = 1;
                echo "<h3>{$getName}'s Dashboard</h3><br/>";
                $db = mysql_connect(db_server, $db_user, $db_password);
                mysql_select_db($db_dbname);
                $result = mysql_query("describe Security");
                $result2 = mysql_query("SELECT * FROM Security WHERE RUID=$getRuid");

                $count = mysql_num_rows($result2);
                $r = mysql_fetch_array($result2);

                $ct = 0;

                while ($row = mysql_fetch_array($result)) {
                    if ($count > 0) {
                        $show = $r[$row['Field']];
                    }
                    if ($row['Field'] != 'RUID' && $show == 1) {
                        echo '<a href="' . strtolower($row['Field']) . '.php?ruid=' . $getRuid . '">' . $row['Field'] . '</a><br></br>';
                        echo "\n";
                        $ct++;
                    }
                }
                if ($ct == 0) {
                    echo "$getName has chosen to keep his information private.";
                }
                
                echo "<br><br>";
                echo "<h3>Mutual Friends</h3>";
                $sql = "SELECT U.FirstName, U.LastName, U.RUID FROM Users U, Friends F1, Friends F2 WHERE F1.Person1=$myRuid AND F2.Person1={$_GET['ruid']} AND F1.Person2=F2.Person2 AND F1.Person2<>{$_GET['ruid']} AND F2.Person2<>$myRuid AND F1.Status='Accepted' AND F2.Status='Accepted' AND F1.Person2=U.RUID";
                if(!outputQueryResults($sql))
                    echo "No mutual friends.";
                ?>
                <br>

            </div> <!-- end #content -->

            <?php include('includes/sidebar.php'); ?>

            <?php include('includes/footer.php'); ?>

        </div> <!-- End #wrapper -->

    </body>

</html>